package org.spring.boot.func.properties;

import org.spring.boot.func.tool.callback.FuncCallback;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author Yiur
 */
@ConfigurationProperties(prefix = "func.link")
public class FuncProperties {

    private String classesScan;
    private boolean lambda;
    private boolean isSingleton;
    private Class<?> callBack;
    private Logger logger;
    public static String DEFAULT_MESSAGE = "call method --> ?{methodName}(?{parameterSource})";

    public FuncProperties() {
        lambda = true;
        isSingleton = true;
        callBack = FuncCallback.class;
        logger = new Logger(true, DEFAULT_MESSAGE);
    }

    public String getClassesScan() {
        return classesScan;
    }

    public void setClassesScan(String classesScan) {
        this.classesScan = classesScan;
    }

    public boolean isLambda() {
        return lambda;
    }

    public void setLambda(boolean lambda) {
        this.lambda = lambda;
    }

    public boolean isSingleton() {
        return isSingleton;
    }

    public void setSingleton(boolean singleton) {
        isSingleton = singleton;
    }

    public Class<?> getCallBack() {
        return callBack;
    }

    public void setCallBack(Class<?> callBack) {
        this.callBack = callBack;
    }

    public Logger getLogger() {
        return logger;
    }

    public void setLogger(Logger logger) {
        this.logger = logger;
    }

    public static class Logger {

        public Logger() {
        }

        public Logger(boolean enableLog, String message) {
            this.enableLog = enableLog;
        }

        public boolean enableLog;
        public String message;

        public boolean isEnableLog() {
            return enableLog;
        }

        public void setEnableLog(boolean enableLog) {
            this.enableLog = enableLog;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

    }

}
